#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int N = 1010;
const int M = 1e6+10;

int dp[M],a[N],w[N],allval,n,k;

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,k = in;
	for(int i = 1;i <= n;i++) a[i] = in;
	sort(a+1,a+n+1);
	for(int i = 1;i <= n;i++) w[i] = a[i] - a[1];
	int allval = k * 1000; memset(dp,0x3f,sizeof(dp)); dp[0] = 0;
	for(int i = 1;i <= n;i++){
		for(int j = w[i];j <= allval;j++){
			dp[j] = min(dp[j],dp[j-w[i]] + 1);
		}
	}
	for(int i = 0;i <= allval;i++) if(dp[i] <= k) printf("%d ",i + a[1] * k);
	return 0;
}

